const path = require('path')
function resolve (dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  publicPath: './',
  lintOnSave: true,
  productionSourceMap: false,

  devServer: {
    proxy: {
      '/proxy': {
        target: 'http://jyhpay.herbsexcolor.com/index.php?s=Weixin/api/',
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/proxy': ''
        }
      }
    }
  },

  chainWebpack: config => {
    config.resolve.alias
      .set('styles', resolve('src/assets/styles'))
      .set('less', resolve('src/assets/less'))
      .set('~js', resolve('src/assets/js'))
  },

  css: {
    loaderOptions: {
      stylus: {
        'resolve url': true,
        'import': []
      }
    }
  },

  pluginOptions: {
    'cube-ui': {
      postCompile: false,
      theme: false
    }
  }
}
